package com.luochen.cdpt.controller;

import com.luochen.cdpt.eneity.OrgInfo;
import com.luochen.cdpt.eneity.Page;
import com.luochen.cdpt.response.RespBean;
import com.luochen.cdpt.service.OrgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @Auther: star
 * @Date: 2018/12/16 09:40
 * @Description:
 */
@RestController
public class OrgInfoController {

    @Autowired
    private OrgService orgService;

    /**
     * 通过条件查询员工列表
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/org/list",method = RequestMethod.GET )
    public Page<OrgInfo> list(HttpServletRequest request) {
        return  orgService.list(request);
    }

    /**
     * 保存机构
     * @param orgInfo
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/org/save",method = RequestMethod.POST )
    public RespBean save(@RequestBody OrgInfo orgInfo){
        return orgService.save(orgInfo);
    }
}
